#ifndef _lee_type_and_common_define_h
#define _lee_type_and_common_define_h

#ifndef UNIX
#include <stddef.h>
#endif
#include <memory>

enum class eYesNo {
	no = 0,
	yes = 1,
};

using error_code = int;
enum eCommonRev {
	done = 0,
	fail = -1,
	argument_error = -2,
	new_fail = -3,
	redo = -4,
	buf_use_up = -5,
	system_error = -6,
	invalid_operation = -7
};


using byte = unsigned char;
using uint8 = unsigned char;
using uint16 = unsigned short int;
using uint32 = unsigned int;
using uint64 = unsigned long long int;
using int8 = signed char;
using int16 = signed short int;
using int32 = signed int;
using int64 = signed long int;

using u32to8 = union{
	uint32 u32;
	uint32 u24 : 24;
	uint8 u8[4];
	uint16 u16[2];
};
using u24to8 = union {
	uint32 u24 : 24;
	uint8 u8[3];
};

using u16to8 = union
{
	uint16 u16;
	void* v;
	uint8 u8[2];
};

#if defined( WIN32)|| defined( WIN64)
#define __EXPORT_DLL __declspec(dllexport)

#elif  defined(UNIX)
#define __EXPORT_DLL 
#define __stdcall __attribute__((stdcall))
#endif 

#endif// _lee_type_and_common_define_h
